package com.hxkj.domain.po;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Objects;

/***
 * 消息队列封装类
 * ***/
public class EventMessage implements Serializable {


    private static final long serialVersionUID = 8791195741179590415L;
    private String queueName;

    private String exchangeName;

    private byte[] eventData;

    private Long siteId;

    private Object obj;

    public EventMessage(String queueName, String exchangeName, byte[] eventData, Long siteId, Object obj) {
        this.queueName = queueName;
        this.exchangeName = exchangeName;
        this.eventData = eventData;
        this.siteId = siteId;
        this.obj=obj;
    }

    public EventMessage() {
    }

    public String getQueueName() {
        return queueName;
    }

    public String getExchangeName() {
        return exchangeName;
    }

    public byte[] getEventData() {
        return eventData;
    }

    public Long getSiteId() {
        return siteId;
    }

    public void setSiteId(Long siteId) {
        this.siteId = siteId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof EventMessage)) return false;
        EventMessage that = (EventMessage) o;
        return Objects.equals(queueName, that.queueName) &&
                Objects.equals(exchangeName, that.exchangeName) &&
                Arrays.equals(eventData, that.eventData) &&
                Objects.equals(siteId, that.siteId);
    }

    @Override
    public int hashCode() {

        int result = Objects.hash(queueName, exchangeName, siteId);
        result = 31 * result + Arrays.hashCode(eventData);
        return result;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }
}
